﻿using MediatR;
using T.Basic.Domain.T.Basic.Model;
using T.Basic.Read.API.Appliction.Command.VehicleCommand;
using T.Basic.Repository.BasicInterface;

namespace T.Basic.Read.API.Appliction.CommandHandlers.VehicleHanders
{
    /// <summary>
    /// 显示车牌号
    /// </summary>
    public class VehicleShowPlateNumberCommandHander : IRequestHandler<VehicleShowPlateNumberCommand, List<Vehicle>>
    {
        private readonly IVehicleRepository _vehicleRepository;
        public VehicleShowPlateNumberCommandHander(IVehicleRepository vehicleRepository)
        {
            _vehicleRepository = vehicleRepository;
        }
        public async Task<List<Vehicle>> Handle(VehicleShowPlateNumberCommand request, CancellationToken cancellationToken)
        {
            return await _vehicleRepository.GetAllAsync();
        }
    }
}
